<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" lang="zh-CN">
<head>
    <title>用户管理</title>

    <th:block th:include="fragment_header :: header">
    </th:block>
</head>
<body>
<div th:replace="fragment_menu :: navmenu"></div>
<h2 class="text-center">用户管理</h2>

<div class="card">
    <div style="margin-left: 10px;margin-top: 10px">
        <a th:href="@{ ${ #mvc.url('SC#add2').build() } }" class="btn btn-primary">新增用户</a>
    </div>

    <div class="alert alert-success alert-dismissible fade show" th:if="${ success eq 'success' }">
        <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
        <strong th:text="${success}">success</strong>
    </div>


    <div class="card-body">
        <table class="table table-striped table-hover text-center">
            <thead>
            <tr>
                <th>工号</th>
                <th>姓名</th>
                <th>性别</th>
                <th>邮箱</th>
                <th>手机</th>
                <th>操作</th>
            </tr>
            </thead>

            <!--td 表示行中的一个列,需要嵌套在tr中间-->
            <tbody>
            <tr th:each="studentModel: ${studentModels}">
                <td th:text="${studentModel.employeeNo}">employeeNo</td>
                <td th:text="${studentModel.name}">name</td>
                <td th:text="${studentModel.gender}">gender</td>
                <td th:text="${studentModel.email}">email</td>
                <td th:text="${studentModel.mobile}">mobile</td>

                <td>
                    <a th:href="@{/student/edit/{id}(id=${studentModel.id})}" class="btn btn-primary btn-sm">编辑</a>
                    <a th:href="@{/student/delete/{id}(id=${studentModel.id})}" class="btn btn-danger btn-sm">删除</a>&nbsp;
                </td>

            </tr>
            </tbody>
        </table>
    </div>


</div>

</body>
</html>
